import typescript from '@rollup/plugin-typescript';
import { uglify } from 'rollup-plugin-uglify';
import { resolve } from 'path';
import commonjs from '@rollup/plugin-commonjs';

// const entryFile = resolve(__dirname, './src/index.ts');
const entryFile = resolve(__dirname, './src/index.ts');
const outDir = resolve(__dirname, './dist');

export default {
  input: entryFile,
  external: [
    "fs",
    "path",
    "uuid",
    "lodash",
  ],
  plugins: [
    typescript({
      tsconfig: resolve(__dirname, './tsconfig.build.json'),
      outDir,
      incremental: false,
      declaration: false,
      allowJs: true,
      target: 'es5',
      module: 'ES2015',
      // module: 'commonjs',
    }),
    commonjs(),
    uglify(),
  ],
  output: {
    name: 'BoolBundle',
    dir: outDir,
    format: 'umd',
  },
};
